﻿/********************************************************************************
** @ Date:2023/11/07
** @ Author: WeiXiaoYu
** @ Description: Pdf报表输出类(目前废弃了,后面删除)
** @ Version:1.0.0
** @ Fun:
********************************************************************************/
#ifndef CPdfReport_H
#define CPdfReport_H

#include <QObject>
#include "HeaderFile.h"
#include <QPrinter>
#include <QPainter>

#include "COptPdfRptBase.h"


class CPdfReport  : public QObject
{
	Q_OBJECT

public:
	CPdfReport(QObject *parent = nullptr);
	~CPdfReport();

public:
	static void getBetwTwoRollerCotData(int nStartRoller, int nEndRoller, QMap<int, QVector<CPdfCotIrInfo>> &mapCotIr, QMap<int, QVector<CPdfCotVoiceInfo>> &mapCotVoice, QVector<CPdfCotIrInfo> &vecAllCotIr, QVector<CPdfCotVoiceInfo> &vecAllCotVoice);//获取两点托辊号之间的 连续红外检测数据、连续噪声检测数据
	static void getCotMapIrData(QMap<int, QVector<CPdfCotIrInfo>> &mapCotIr, QVector<CPdfCotIrInfo> &vecAllCotIr);//获取连续检测红外Map数据
	static void getCotMapVoiceData(QMap<int, QVector<CPdfCotVoiceInfo>> &mapCotVoice, QVector<CPdfCotVoiceInfo> &vecAllCotVoice);//获取连续检测声音Map数据
	static void getCotMapImageData(QMap<int, QVector<CPdfCotImageInfo>> &mapCotImage, QVector<CPdfCotImageInfo> &vecAllCotImage);//获取连续检测图像Map数据
	static void calculateCotRetBelongTier(QMap<int, QVector<CPdfCotIrInfo>> &mapCotIr, QMap<int, QVector<CPdfCotVoiceInfo>> &mapCotVoice, QMap<int, QVector<CPdfCotImageInfo>> &mapCotImage);//计算连续检测结果归属层级
	static void drawNewPageCotIr(QMap<int, QVector<CPdfCotIrInfo>> &mapCotIrInfo, QPainter &painter, QPrinter &printer);//绘制新的一个连续红外
	static void drawNewPageCotAll(QMap<int, QVector<CPdfCotIrInfo>> &mapCotIrInfo, QMap<int, QVector<CPdfCotVoiceInfo>> &mapCotVoice, QMap<int, QVector<CPdfCotImageInfo>> &mapCotImage, QPainter &painter, QPrinter &printer);//绘制所有的连续检测数据
	static void drawGroupCot(int nDrawType, int &nRowTemporary, QVector<CPdfCotIrInfo> vecDataIr, QVector<CPdfCotVoiceInfo> vecDataVoice, QVector<CPdfCotImageInfo> vecDataImage, QPainter &painter);//画一组连续检测

public:
	//************************************
	// Method:    outputPdfReportInfo
	// FullName:  CPdfReport::outputPdfReportInfo
	// Access:    public 
	// Returns:   void
	// Qualifier:
	// Parameter: CPdfReportInfo CRobData 输出的Pdf信息
	//************************************
	static bool outputPdfReportInfo(CPdfReportInfo CRobData, QString &sErrMsg);//输出pdf报表信息(机器人巡检任务)

	static bool outputSynthPdfRptInfo(CPdfReportInfo CRobData, CPdfRectifyInfo &CRectifyData, CPdfTearInfo &CTearData, CPdfExtraAiInfo &CExtraAiInfo, QString &sErrMsg);//输出综合性报表(机器人巡检任务、纠偏、撕裂)

	//导出报表(机器人巡检任务)
	static bool exportRobReport(CTaskExecInfo* pTaskExecInfo, CDevDataBase* pDevData, QString strComment, QString &sErrMsg);

	//导出综合报表(机器人巡检任务、纠偏、撕裂、其他AI检测)
	static bool exportSynthReport(CTaskExecInfo* pTaskExecInfo, CDevDataBase* pDevData, QString strComment, CPdfRectifyInfo &CRectifyData, CPdfTearInfo &CTearData, CPdfExtraAiInfo &CExtraAiInfo, QString &sErrMsg);
};

#endif
